-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(v2): allow non sidebar category to be first item of sidebar #2032
Conversation
Deploy preview for docusaurus-2 ready! Built with commit 0b931e4 |
Deploy preview for docusaurus-preview ready! Built with commit 0b931e4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice tests
@@ -171,19 +171,16 @@ function DocSidebar(props) { | |||
)} | |||
</button> | |||
<ul className="menu__list"> | |||
{sidebarData.map( | |||
item => | |||
item.items.length > 0 && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not need to check anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the first item is not a category, items is undefined. Checking is alrd done in the DocSidebarItem itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without this loc removal, it will error
Ok please resolve conflicts and self-merge :D |
Yeah that will have to wait maybe tonight. I have plans for today |
5ffbf48
to
ab2a1af
Compare
thank you! 🎉 |
Motivation
This allows user to define sidebar item as the first level item of a sidebar. If previously its defined like this
Its now
Other changes
Updated babel so i can use TS 3.7 assertion
Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
Here's a cool demo showing it. You can directly click "Creating Pages"